package org.example.model.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author weigang
 * @create 2022-11-08 15:40
 */
@Data
public class FullUserVO implements Serializable {
    private static final long serialVersionUID = -5397435351542071174L;

    /**
     * sys_user 表id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /**
     * 用户名/itcode
     */
    @Size(max = 50, message = "length more then 50")
    @NotBlank(message = "not null")
    private String userName;

    /**
     * 锁定标记（0 未锁定 1锁定）
     */
    @Range(min = 0, max = 32767, message = "between 0 and 32767")
    @NotNull(message = "not null")
    private Integer lockFlag;

    /**
     * 手机号
     */
    @Size(max = 20, message = "length more then 20")
    private String phone;

    /**
     * 邮箱
     */
    @Size(max = 50, message = "length more then 50")
    private String email;

    /**
     * 部门表id
     */
    @NotNull(message = "not null")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long deptId;

    /**
     * 最后登录时间
     */
    private LocalDateTime lastLoginTime;

    /**
     * 最后登录ip
     */
    @Size(max = 50, message = "length more then 50")
    private String lastLoginAddr;


}
